import { BaseProgressBar } from "./BaseProgressBar";
type int = number;
//class VerticalProgressBar

    export  class VerticalProgressBar extends BaseProgressBar
    {
        constructor(arg1: string=null, arg2: Boolean=false)
        {
            super(arg1, arg2);
            return;
        }

        public set startPointY(arg1: int)
        {
            this._startPointY = arg1;
            return;
        }

        public /* override */ setValue(arg1: number, arg2: number, arg3: number=1): void
        {
            var loc1=0;
            _value = arg1;
            _totalValue = arg2;
            if (arg1 > arg2) 
            {
                if (arg1 > 0 && arg2 > 0) 
                {
                    _progressBar.scaleY = arg3;
                }
                else 
                {
                    _progressBar.scaleY = 0;
                }
            }
            else 
            {
                _progressBar.scaleY = arg3 * arg1 / arg2;
            }
            _progressBar.y = progressBarBg.height - this._startPointY - _progressBar.height;
            setLabelPosition(0, (_progressBarBg.height - this._startPointY) / 2);
            _label.width = _progressBarBg.width;
            if (_showProgressText) 
            {
                if (_showPercentText) 
                {
                    if (arg2 != 0) 
                    {
                        if ((loc1 = Math.ceil(arg1 / arg2 * 100)) > 100) 
                        {
                            loc1 = 100;
                        }
                        _label.text = loc1 + "%";
                    }
                    else 
                    {
                        _label.text = "0%";
                    }
                }
                else 
                {
                    _label.text = arg1 + "/" + arg2;
                }
            }
            return;
        }

        protected /* var */_startPointY: int=77;
    }
